<?php

namespace app\common\validate;

use think\Validate;

class Cars extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'	=>	['规则1','规则2'...]
     *
     * @var array
     */	
	protected $rule = [
	    'equipment_id'  => 'require',
	    'sim_id'   => 'require',
	    'cardcode' => 'require',
	    'supplier_no'=>'require'
	];
    
    /**
     * 定义错误信息
     * 格式：'字段名.规则名'	=>	'错误信息'
     *
     * @var array
     */	
    protected $message = [
        'equipment_id.require' => '设备号不能为空',
        'sim_id.require' => '卡序列号不能为空',
        'cardcode.require' => '卡号不能为空',
        'supplier_no.require' => '车机型号不能为空',
    ];
    
    protected $scene = [
        'driver'  =>  ['equipment_id','sim_id','cardcode','supplier_no'],
        'sim'     =>  ['sim_id','cardcode','supplier_no'],
    ];
}
